#include <iostream>
using namespace std;


template <class t>
void output(const t &n)
{
    cout << n << endl;
}

template <class t>
void swap_these(t &a, t &b)
{
    t temp = a;
    a = b;
    b = temp;
}

int main()
{
    int array[5] = {1,2,3,5,4};
    for(int i = 0; i < 5; i++)
    {
        cout << array[i] << " ";
    }
    cout << endl;
    swap_these(array[3], array[4]);
    for(int i = 0; i < 5; i++)
    {
        cout << array[i] << " ";
    }
    output("Works!");
}
